package com.example.demo.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Controller
public class HellowController {
    //传入index首页的数据会激活这个控制器。requestMapping相当于监听器。
    @RequestMapping("/index")
    public String sayHello(){
        return "index";
    }
    @RequestMapping(value = "/test")
    public String test(){
        return "test";
    }
    //跳转登录界面
    @RequestMapping(value = "/login")
    public String toLogin(){
        return "login";
    }
    //跳转注册界面
    @RequestMapping(value = "/register")
    public String toRegister(){
        return "register";
    }
    //首页
    @RequestMapping(value = "/header")
    public String toHeader(){
        return "header";
    }
}
